
package ProOF.apl.problems.real.functions;

import ProOF.com.LinkerParameters;

/**
 *
 * @author Hossomi
 */
public class RealFuncB2 extends aRealFunction{

	@Override
	public void parameters(LinkerParameters link) throws Exception {

	}
	
	@Override
	public int dimension() {
		return 2;
	}
	
	@Override
	public double min( int i ) {
		return -50;
	}
	
	@Override
	public double max( int i ) {
		return 50;
	}

	@Override
	public double f(double[] x) throws Exception {
		check(x);
        
        return x[0]*x[0] + 2*x[1]*x[1] -
                0.3 * Math.cos(3*Math.PI*x[0]) - 
                0.4 * Math.cos(4*Math.PI*x[1]) +
                0.7;
	}

	@Override
	public String name() {
		return "B2";
	}

	@Override
	public String description() {
		return "Bohachevsky function";
	}	
}
